package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.queryobject.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int delete(Long id);

    int insert(Employee record);

    Employee selectOne(Long id);

    List<Employee> listAll();

    int update(Employee record);

    int queryForCount(QueryObject qo);

    List<Employee> queryForList(QueryObject qo);

    // 插入中间表信息
    void insertRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    // 删除中间表
    void deleteRelation(Long id);

   Employee selectUsernameAndPassword(@Param("username") String username, @Param("password") String password);

   // 员工修改密码
    void updatePwd(@Param("id") Long id, @Param("password") String password);

    Employee selectUser(Long id);

    void batchDelete(@Param("ids") Long[] ids);

    Employee checkName(String name);

    Employee selectById(Long id);

    Employee selectByName(String name);

    //修改员工的状态
    void updateState(@Param("id") Long id, @Param("status") int status);

    List<Employee> selectByRoleSn(String... sns);

}
